package com.IO流.处理流;

import java.io.*;

public class Buffered_Exercise_01 {
    public static void main(String[] args) throws IOException {
        String SrcFilePath = "D:\\A-javacode\\java-code\\src\\com\\坦克大战\\Tank_5\\MyPanel.java";   //被拷贝的文件路径
        String DestFilePath = "D:\\JAVA_test\\bufferedExercise01.java";                             //目标路径

        BufferedReader bufferedReader = new BufferedReader(new FileReader(SrcFilePath));            //创建输入处理流
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(DestFilePath));           //创建输出处理流

        String readData = "";                                                                       //存放读取到的数据
        while((readData = bufferedReader.readLine()) != null) {                                     //如果还能读取这一行
            bufferedWriter.write(readData);                                                         //将读取到的字符串写进去
            bufferedWriter.newLine();                                                               //写入一行就换行
        }

        bufferedReader.close();                                                                     //关闭输入流
        bufferedWriter.close();                                                                     //关闭输出流
        System.out.println("拷贝完成");
    }
}
